<?php
$url = '';
$text = '';
if ($type != 'class') {
    $url = 'Courses/admin';
    $text = 'Courses';
} else {
    $url = 'classes/admin';
    $text = 'Classes';
}
$this->menu = array(
    array('label' => Yii::t('app', 'Manage ') . $text, 'url' => array($url)),
);
?>


<h3><?php echo Yii::t('app', 'Suggest tag '); ?></h3>
<script type="text/javascript">
    function ChangeStatus(id, status)    {
        $.ajax({
            url: "<?php echo Yii::app()->createUrl('classCourseTags/statuschange/'); ?>",
            type: "post",
            data: "id=" + id + "&status=" + status,
            dataType: "html",
            success: function(msg) {
                $('#class-course-tags-grid').yiiGridView.update('class-course-tags-grid');
            }
        });

    }


</script>

<?php
$this->widget('zii.widgets.grid.CGridView', array(
    'id' => 'class-course-tags-grid',
    'dataProvider' => $model,
    'columns' => array(
        //'id',
       
        array('name' => 'tag_name',
            'type' => 'raw',
            'value' => 'CHtml::link($data->tag_name,array("classCourseTags/update","id"=>$data->id))'),
        array(
            'name' => 'status',
            'type' => 'raw',
            'value' => 'changeStatusIngridView($data)',
            'filter' => array('0' => Yii::t('app', 'Inactive'), '1' => Yii::t('app', 'Active')),
        ),
        'create_time',
    ),
));
?>